<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>操作日志</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="./static/css/font.css">
    <link rel="stylesheet" href="./static/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="./static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./static/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body class="layui-anim layui-anim-up">
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">系统设置</a>
        <a>
          <cite>操作日志</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<ul class="layui-timeline" id="timeLine">

</ul>

<script>
    // 获取所有日志信息
    $.ajax({
        type: "post",
        url: "${pageContext.request.contextPath}/log?m=logList",
        dataType: "json",
        success: function (data) {
            if (data.code === 200) {
                $(data.data).each(function () {
                    if (this.logIsSuccess == 0){
                        $('#timeLine').append('<li class="layui-timeline-item">\n' +
                            '        <i class="layui-icon layui-timeline-axis"></i>\n' +
                            '        <div class="layui-timeline-content layui-text">\n' +
                            '        <div class="layui-timeline-title" STYLE="color:red;">'+this.logTime+"   "+this.logContent+'</div>\n' +
                            '        </div>\n' +
                            '    </li>');
                    }else {
                        if (this.logWorkerName!=null){
                            $('#timeLine').append('<li class="layui-timeline-item">\n' +
                                '        <i class="layui-icon layui-timeline-axis"></i>\n' +
                                '        <div class="layui-timeline-content layui-text">\n' +
                                '        <div class="layui-timeline-title" STYLE="color:blue;">'+this.logTime+"  【"+this.logWorkerName+"】"+this.logContent+'</div>\n' +
                                '        </div>\n' +
                                '    </li>');
                        }else {
                            $('#timeLine').append('<li class="layui-timeline-item">\n' +
                                '        <i class="layui-icon layui-timeline-axis"></i>\n' +
                                '        <div class="layui-timeline-content layui-text">\n' +
                                '        <div class="layui-timeline-title" STYLE="color:green;">'+this.logTime+"   "+this.logContent+'</div>\n' +
                                '        </div>\n' +
                                '    </li>');
                        }

                    }

                });
            }
        }
    });
</script>
</body>

</html>